Changing wmode param on the fly

148 views
Skip to first unread message

Prescient

unread,
Jul 29, 2008, 9:16:46 PM7/29/08
to SWFObject
I'm trying to set the wmode to 'window' on the fly but I am new to
swfobject and not certain that this is even possible. The script I'm
currently using is:

----------------------
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};

var params = {
allowfullscreen: "true",
wmode: "transparent"
};

var attributes = {
id: "gallery",
name: "gallery"
};

swfobject.embedSWF("gallery.swf", "gallery", "755", "533", "9.0.0",
false, flashvars, params, attributes);

function changeWmode(input) {
// Not sure what to put here in order to
change the wmode parameter.
};
</script>
---------------------------



Any help would be greatly appreciated.
~Cheers

Sam Sherlock

unread,
Jul 29, 2008, 9:25:07 PM7/29/08
to swfo...@googlegroups.com
               function changeWmode(input)  {
                       params.wmode = input;
                 };

you'll have to call that before embedding the swf eg before swfobject.embedSWF

if you're trying to change a swf that is already embedded (AFAIK) you'll have to remove the swf then add it again changining the param before making the call.  In this case the swf will be added using swfobject.createSWF as the page is already loaded

2008/7/30 Prescient <jper...@gmail.com>

Prescient

unread,
Jul 30, 2008, 3:02:02 AM7/30/08
to SWFObject
Thank you for the swift replies. So far, I have effectively removed
the original swf and replaced it with a replica with the wmode set
correctly (wmode: "window"). Unfortunately, my end goal is to get
this replica swf to display in full screen. Now that I have the
correct wmode I'm attempting to call an actionscript function from
javascript to change the Stage.displaystate="fullscreen"; however, I'm
not sure if this is even plausible. I've been looking at toolkits
(i.e. http://osflash.org/projects/flashjs/tutorials/astojs) in order
to get this working properly but I'm curious if there is a preferred
method. In fact, I'm curious if there is any method to display a swf
in fullscreen with javascript/actionscript bridges?
Once again, thanks for the replies.
~cheers

Aran Rhee

unread,
Jul 30, 2008, 3:49:37 AM7/30/08
to swfo...@googlegroups.com
The built in ExternalInterface class in F8+ is the way to go for your
browser < > flash communications. There are plenty of tutorials out there,
and it is actually really easy to set up / use.

That being said, I am unsure if you will be able to invoke a full screen
mode without user interaction. I remember there were a whole bunch of
security measures added to the full screen mode to stop malicious
programmers fooling users into thinking they were somewhere they were not
(also the reason no text input is available in full screen mode)


Cheers,
Aran

Bobby

unread,
Jul 30, 2008, 5:38:06 AM7/30/08
to SWFObject
RE: am unsure if you will be able to invoke a full screen mode without
user interaction

You can't . You need a mouse click or keypress for that, need to set
the allowfullscreen param in your embed code, and of course a visitor
needs to have a minmal Flash Player version.
Reply all
Reply to author
Forward
0 new messages